package com.work.util;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ResponseResult<T> {

    private String code;

    private String message;

    private T data;



    public ResponseResult(String code, String message) {
        this.code = code;
        this.message = message;
    }

    //提供OK方法
    public static  ResponseResult OK(){
        return new ResponseResult("1","成功");
    }

    //提供FAIL方法
    public static ResponseResult FAIL(){
        return new ResponseResult("2","失败");
    }

    //提供别的返回方法
    public static ResponseResult response(){
        return new ResponseResult();
    }
}
